<ion-view title="申请详情">
  <ion-content>
    <ion-refresher
        pulling-text="下拉刷新..."
        on-refresh="vacationsDetailCtrl.doRefresh()">
    </ion-refresher>
    <div class="list wrapper">
      <div class="item">
        申请编号：{{vacationsDetailCtrl.vacation.vacationInfo.leaveId}}
      </div>
      <div class="item">
        类型：{{findFirstType(vacationsDetailCtrl.vacation.vacationInfo.type).name}}
      </div>
      <div class="item item-divider">
        <div class="">
          <p ng-repeat="item in vacationsDetailCtrl.vacation.vacationInfo.leaveTimes" style="text-align: center">
            {{item.startTime | date:'yy年MM月dd日 HH点'}}
            ~
            {{item.endTime | date:'yy年MM月dd日 HH点'}}
          </p>
          <!-- <p ng-repeat="item in timelist" style="text-align: center">
            {{item.startdate | date:'yy年MM月dd日'}}
            <standard-time-no-meridian etime="item.starttime"></standard-time-no-meridian>
            ~
            {{item.enddate | date:'yy年MM月dd日'}}
            <standard-time-no-meridian etime="item.endtime"></standard-time-no-meridian>
          </p> -->
        </div>
      </div>
      <div class="item item-body">
        {{vacationsDetailCtrl.vacation.vacationInfo.reason}}
      </div>

      <!-- <div class="item item-divider">
				TODO 材料
			</div> -->
      <div class="item">
        <div class="row">
          <div class="col col-33" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl1">
            <img alt="" ng-src="{{vacationsDetailCtrl.vacation.vacationInfo.imgurl1}}" style="width: 100%" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl1">
          </div>
          <div class="col col-33" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl2">
            <img alt="" ng-src="{{vacationsDetailCtrl.vacation.vacationInfo.imgurl2}}" style="width: 100%" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl2">
          </div>
          <div class="col col-33" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl3">
            <img alt="" ng-src="{{vacationsDetailCtrl.vacation.vacationInfo.imgurl3}}" style="width: 100%" ng-show="vacationsDetailCtrl.vacation.vacationInfo.imgurl3">
          </div>
        </div>
      </div>
    </div>
    <timeline>
      <timeline-event ng-click="vacationsDetailCtrl.goVacationDelay(event)" ng-repeat="event in vacationsDetailCtrl.vacation.vacationLogs">
        <timeline-badge>
        	<img ng-src="{{event.user.avatorImg? event.user.avatorImg : 'img/ben.png'}}" style="width: 100%; border-radius: 50%">
        </timeline-badge>
        <timeline-panel>
          <timeline-heading>
            <h4>{{event.title}}
              <span style="font-size: 12px; color: #aaa">{{event.user.name}}</span>
              <!-- <span style="font-size: 12px; color: #aaa">{{event.userId}}</span> -->
            </h4>
          </timeline-heading>
          <p>{{event.log}}</p>
          <p class="note-text">{{event.updatetime |date: "yy-MM-dd HH:mm"}}</p>
          <p class="note-text" ng-if="event.leaveDelayId">查看该延期详情</p>
        </timeline-panel>
      </timeline-event>
    </timeline>
    <div style="height: 90px"></div>
  </ion-content>

  <div class="fixed-bottom" ng-class="{'fixed-bottom-withtabs': vacationsDetailCtrl.statusUtil.allowAddDealy(vacationsDetailCtrl.vacation.vacationInfo)}" style="height: 50px;color: #343434; background-color:#eee" ng-click="scrollBottom()">
    <p style="line-height: 50px; text-align: center">当前状态：{{vacationsDetailCtrl.vacation.vacationInfo.status | vacationStatusZh}}</p>
  </div>

  <div class="fixed-bottom">
    <button class="button button-full button-positive no-margin" ui-sref="tab.vacations.adddelaydetail({id: vacationsDetailCtrl.$stateParams.id})" ng-if=" vacationsDetailCtrl.statusUtil.allowAddDealy(vacationsDetailCtrl.vacation.vacationInfo)">申请延期</button>
  </div>
</ion-view>
